package actor

// IProcess 定义了actor交互的接口
type IProcess interface {
	IsDead() bool
	Start()
	Stop()
	SendMessage(message interface{}, sender *PID)
}

var (
	gDeadProcess IProcess = &deadProcess{}
)

type deadProcess struct {
}

func (deadProcess) IsDead() bool {
	return true
}

func (deadProcess) Start() {
}

func (deadProcess) Stop() {
}

func (deadProcess) SendMessage(message interface{}, sender *PID) {
	logger.Error("[%s] can not send [%T]:[%s] to a dead process", sender, message, message)
}
